package com.managerstudy.managerback.service;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.managerstudy.managerback.entity.Employee;
import com.managerstudy.managerback.mapper.EmployeeMapper;
import com.managerstudy.managerback.utils.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeService {

    @Autowired
    EmployeeMapper employeeMapper;

    public PageInfo<Employee> getAll(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Employee> list =employeeMapper.getAll();
        return new PageInfo<>(list);


    }

    public Employee selectById(int id) {
        return employeeMapper.selectById(id);
    }
}
